﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls; 
using Runda.CMS.Common.Entity;
namespace Runda.CMS.Portal
{
    public class BaseControl : System.Web.UI.UserControl
    {

        /// <summary>
        /// 当前登录用户
        /// </summary>
        protected Guid CurrentUserID
        {
            get
            {
                if (Session["CurrentUserID"] == null)
                {
                    return Guid.Empty;
                }
                else
                {
                    return new Guid(Session["CurrentUserID"].ToString());
                }
            }
        }

        /// <summary>
        /// 当前用户实体
        /// </summary>
        protected SysUserEntity CurrentUser
        {
            get
            {
                try
                {
                    if (HttpContext.Current.Session["CurrentUserEntity"] == null)
                    {
                        HttpContext.Current.Session["CurrentUserEntity"] = null;
                    }

                    SysUserEntity sessionUser = (SysUserEntity)Session["CurrentUserEntity"];

                    return sessionUser;
                }
                catch
                {
                    return null;
                }
            }
        }


    }
}
